import Nerv from 'nervjs'
import { HashRouter, Routes, Route } from 'react-router-dom'
import { routes } from './router/index'

class App extends Nerv.Component {
  render() {
    return (
      <HashRouter>
        <Routes>
          {routes.map((m) => {
            const Element = m.element
            return <Route key={m.name} path={m.path} element={<Element />} />
          })}
        </Routes>
      </HashRouter>
    )
  }
}

export default App
